// FrameBufferQueue.h

#pragma once

#ifndef ASSERT
#define ASSERT(expr)  _ASSERTE(expr)
#endif

class FrameBufferQueue
{
public:
    FrameBufferQueue(int iPreallocSize = 0);
    FrameBufferQueue(const FrameBufferQueue& src);
    ~FrameBufferQueue();

public:
    void Empty();
    void Resize(int iSize);
    bool IsEmpty() const;
    int Find(LPVOID iIndex) const;
    bool Add(LPVOID pData);
    bool SetAt(int iIndex, LPVOID pData);
    LPVOID GetAt(int iIndex) const;
    bool InsertAt(int iIndex, LPVOID pData);
    bool Remove(int iIndex);
    int GetSize() const;
    LPVOID* GetData();
    bool EnQueue(LPVOID pData);
    LPVOID DeQueue();

public:
    LPVOID operator[] (int nIndex) const;

protected:
    LPVOID* m_ppVoid;
    int m_nCount;
    int m_nAllocated;
};
